/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: AuthenticationService.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/16 下午4:55
 * LastModified: 2020/03/16 16:55:16
 */

package com.qolome.knowledge.design.pattern.responsibilitychain.demo.authentication;

/**
 * @author Qolome
 * @version V1.0
 * @Description 认证服务
 * @date 2020年 03月16日 16:55:46
 */
public class AuthenticationService {


    public void login(String id, String password) {



      BaseHandler.Builder builder = new BaseHandler.Builder();
        BaseHandler build = builder.addHander(new ValidateBaseHandler())
                .addHander(new LoginBaseHandler())
                .addHander(new AuthBaseHandler()).build();
        build.doHanlder(AuthenticationInfo
                .builder()
                .userId(id)
                .password(password)
                .build());
    }
}
